

import { Form, DatePicker } from 'antd';
import React from 'react';
import { todayMoment } from '../../utils/moment';

export const DatePickerForm = props => {
  const {
    form,

    title='',
    field,

    init, // 需要moment
  } = props;

  return (
    <Form.Item label={title}>
      { 
        form.getFieldDecorator(
          field, {
            initialValue: init || todayMoment()
          })(
          <DatePicker placeholder="请选择日期" />
        )
      }
    </Form.Item>
  );
}